* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.api-status {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: inline-block;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.search-section, .chat-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-section h2, .chat-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.search-form {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2d3748;
}

.form-group select,
.form-group input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.smart-features {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.smart-features h3 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.feature-tips {
    font-size: 14px;
    line-height: 1.6;
}

.feature-tips p {
    margin: 0 0 10px 0;
    opacity: 0.9;
}

.feature-tips ul {
    margin: 10px 0;
    padding-left: 20px;
}

.feature-tips li {
    margin: 8px 0;
    opacity: 0.9;
}

.feature-tips .example {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-style: italic;
    border-left: 4px solid #ffd700;
}

.feature-tips .example em {
    color: #ffd700;
    font-weight: 600;
}

.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.user-message .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background: #5a67d8;
}

.results-section {
    grid-column: 1 / -1;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.routes-container {
    display: grid;
    gap: 20px;
}

.route-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.route-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.route-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2d3748;
}

.route-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #4a5568;
}

.route-details {
    margin-top: 15px;
}

.route-step {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.route-step:last-child {
    border-bottom: none;
}

.transport-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 14px;
    color: white;
    font-weight: bold;
}

.high-speed-rail {
    background: #e53e3e;
}

.flight {
    background: #3182ce;
}

.bus {
    background: #38a169;
}

.ground-transport {
    background: #805ad5;
}

.step-info {
    flex: 1;
}

.step-route {
    font-weight: 600;
    color: #2d3748;
}

.step-time {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.help-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 30px;
}

.help-section h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.help-content {
    display: grid;
    gap: 15px;
}

.help-item {
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 14px;
    line-height: 1.6;
}

.help-item strong {
    color: #2d3748;
    font-weight: 600;
}

/* 段选项下拉框样式 */
.step-time-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-time {
    flex: 1;
}

.segment-dropdown-container {
    flex-shrink: 0;
}

.segment-dropdown {
    width: 120px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: #f7fafc;
    font-size: 11px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-dropdown:hover {
    border-color: #cbd5e0;
    background-color: #edf2f7;
}

.segment-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.segment-dropdown option {
    padding: 6px;
    background-color: white;
    color: #2d3748;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .search-section, .chat-section, .results-section, .help-section {
        padding: 20px;
    }
    
    .route-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .feature-buttons {
        flex-direction: column;
    }
    
    .feature-btn {
        justify-content: center;
    }
}

/* 搜索容器样式 */
.search-container {
    position: relative;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 建议列表样式 */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.highlighted {
    background-color: #e2e8f0;
}

.suggestion-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.suggestion-icon {
    font-size: 16px;
}

.suggestion-name {
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

.suggestion-type {
    font-size: 11px;
    color: #667eea;
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
}

.suggestion-address {
    font-size: 12px;
    color: #718096;
    margin-left: 24px;
    margin-bottom: 2px;
}

.suggestion-fullname {
    font-size: 11px;
    color: #a0aec0;
    margin-left: 24px;
    font-style: italic;
}

/* 错误模态框样式 */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.error-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.error-content h3 {
    color: #e53e3e;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.error-content p {
    color: #4a5568;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.error-content button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.error-content button:hover {
    background: #5a67d8;
}

/* 地图区域样式 */
.map-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.map-section h2 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.control-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 8px 12px;
    margin: 2px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* 顶部搜索栏 */
.top-search-bar {
    background: white;
    padding: 20px;
    margin: 0 20px 20px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-form-horizontal {
    display: flex;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
}

.search-item {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.search-item label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.search-item input,
.search-item select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-item input:focus,
.search-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 主布局 - 两列：地图在左，AI在右 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
}

/* AI助手区域 */
.ai-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.ai-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #68d391;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #68d391;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 地图区域 */
.map-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    position: relative;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.map-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.map-container {
    flex: 1;
    border-radius: 8px;
    margin: 0 20px 20px 20px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.map-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* AI快捷功能 */
.ai-shortcuts {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.ai-shortcuts h3 {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
}

.shortcut-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shortcut-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    text-align: center;
}

.shortcut-btn:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* 路线信息面板 */
.route-info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
}

.route-info-panel h3 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.route-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.route-item .label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.route-item .value {
    font-size: 12px;
    color: #2d3748;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 500px 400px;
    }
    .map-section {
        order: 1;
        height: 500px;
    }
    .ai-section {
        order: 2;
        height: auto;
        min-height: 400px;
    }
    .search-form-horizontal {
        flex-direction: column;
        align-items: stretch;
    }
    .search-item {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .top-search-bar {
        margin: 0 10px 10px 10px;
        padding: 15px;
    }
    .main-content {
        padding: 0 10px 10px 10px;
    }
    .map-container {
        height: 300px;
    }
    .ai-section {
        min-height: 300px;
    }
    .shortcut-buttons {
        grid-template-columns: 1fr;
    }
}